<?php foreach($rs1 as $r)?>
<p>&nbsp;</p>
<div align="center">
  <h1>Raw Material Inspection Report (Starch)</h1>
</div>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="font">
  <tr>
    <td width="12%" height="30">Date</td>
    <td width="27%" height="30">: <?php echo $r['modify_date']; ?></td>
    <td width="18%" height="30">Lot no.</td>
    <td width="43%" height="30">: <?php echo $r['lot_no']; ?></td>
  </tr>
  <tr>
    <td height="30">Type</td>
    <td height="30">: <?php echo $r['type_of']; ?></td>
    <td height="30">Grade</td>
    <td height="30">: <?php echo $r['grade']; ?></td>
  </tr>
  <tr>
    <td height="30">Brand</td>
    <td height="30"> : <?php echo $r['brand']; ?></td>
    <td height="30">Problem</td>
    <td height="30">&nbsp;</td>
  </tr>
    <tr>
    <td height="30">&nbsp;</td>
    <td height="30">&nbsp;</td>
    <td height="30">&nbsp;</td>
    <td height="30">&nbsp;</td>
  </tr>
</table>
<br />
<table width="60%" align="center" class="font">
  <tr>
    <td>
     <table id="grid">
                <thead>
                    <tr>
                        <th data-field="Properties">Properties Item</th>
                        <th data-field="Value">Value</th>
                        <th data-field="Unit">Unit</th>
                    </tr>
                </thead>
                <tbody>
<tr>
<td>Viscosity</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS11')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>(cPs)</td>
</tr>
<tr>
<td>Residue</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS12')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td>
<td>(ppm)</td>
</tr>
<tr>
<td>Residue Suction </td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS13')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>(%)</td>
</tr>
<tr>
<td>pH</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS14')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>&nbsp;</td>
</tr>
<tr>
<td>Moisture Content</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS15')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>(%)</td>
</tr>
<tr>
<td>Dirt Size</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS16')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>(mm<sup>2</sup>)</td>
</tr>
<tr>
<td>Brightness</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS17')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td>
<td>(%)</td>
</tr>
<tr>
<td>Ash Content</td><td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']== 'StarchS18')
				  {
				  	if($r['status']== '1')
						{
							echo $r['data_value'];
						}
					else
						{
			echo "<span class='red'>"."<strong>".$r['data_value']."</strong>"."</span>";
						}
				  }
			  }
			  ?></td><td>(%)</td>
</tr>

                </tbody>
      </table>

            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
						columns: [
						{ field: "Properties", width: "125px" },
						{ field: "Value", width: "20px" },
						{ field: "Unit",  width: "40px" }
						],
                        //height: 1000,
						//pageable: true,
						dataSource: {
						//pageSize: 12
						} 
                    });
                });
            </script>
    </td>
  </tr>
</table>

            <!--scrip list select-->
<script>
                $(document).ready(function() {
                    var viewModel = {
                        chosenTicket: ko.observable(),
                        resetTicket: function() { this.chosenTicket(null) },
                    };
                    $("#ticket1").kendoDropDownList().trigger("change");
                    $("#ticket2").kendoDropDownList().trigger("change");
                    $("#ticket3").kendoDropDownList().trigger("change");
                });
      		</script>
            <!--scrip วัน-เดือน-ปี-->
<script>
                $(document).ready(function() {
                    var today = new Date(),
                        birthdays = [
                           +new Date(today.getFullYear(), today.getMonth(), 11),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 6),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 27),
                           +new Date(today.getFullYear(), today.getMonth() - 1, 3),
                           +new Date(today.getFullYear(), today.getMonth() - 2, 22)
                        ];

                    $("#datepicker").kendoDatePicker({
                        value: today,
                        month: {
                            // template for dates in month view
                            content: '# if ($.inArray(+data.date, [' + birthdays + ']) != -1) { #' +
                                         '<div class="birthday"></div>' +
                                     '# } #' +
                                     '#= data.value #'
                        },
                        footer: "Today - #=kendo.toString(data, 'd') #"
                    });

                    $("#datepicker").data("kendoDatePicker")
                                    .dateView.calendar.element
                                    .width(300);
                });
            </script>
            <!--scrip เวลา-->
<script>
                $(document).ready(function() {
                    // create TimePicker from input HTML element
                    $("#timepicker").kendoTimePicker();
                });
            </script>